DROP TABLE IF EXISTS `shop_category`;
CREATE TABLE `shop_category`
(
    `category_id`            INT UNSIGNED     NOT NULL AUTO_INCREMENT COMMENT '自增主键',
    `category_status`        TINYINT UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态，1=打开，2=关闭',
    `category_name`          CHAR(50)         NULL     DEFAULT NULL COMMENT '分类名',
    `category_parent_id`     INT UNSIGNED     NOT NULL DEFAULT 0 COMMENT '父级 Id',
    `category_top_parent_id` INT UNSIGNED     NOT NULL DEFAULT 0 COMMENT '顶级ID',
    `category_level`         CHAR(200)        NULL     DEFAULT NULL COMMENT '分类层级id，用逗号分隔，如：2,3,4,5',
    `sort`                   INT UNSIGNED     NOT NULL DEFAULT 0 COMMENT '排序',
    `status_delete`          TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除;0:否;1:是;',
    `created_at`             INT UNSIGNED     NOT NULL DEFAULT 0 COMMENT '创建时间',
    `updated_at`             INT UNSIGNED     NOT NULL DEFAULT 0 COMMENT '修改时间',
    PRIMARY KEY (`category_id`)
) ENGINE = INNODB
  DEFAULT CHARSET = UTF8MB4
  COLLATE = UTF8MB4_GENERAL_CI COMMENT ='分类信息表';

BEGIN;
INSERT INTO `shop_category` (`category_id`, `category_status`, `category_name`, `category_parent_id`,
                             `category_top_parent_id`, `category_level`)
VALUES (1, 1, '动物', 0, 0, NULL),
       (2, 1, '用品', 0, 0, NULL),
       (3, 1, '超白系鬃狮', 1, 1, '1'),
       (4, 1, '柑橘系鬃狮', 1, 1, '1'),
       (5, 1, '红系鬃狮', 1, 1, '1'),
       (7, 1, '10CM+', 3, 1, '1,3'),
       (8, 1, '20CM+', 3, 1, '1,3'),
       (9, 1, '30CM+', 3, 1, '1,3'),
       (10, 1, '成体', 3, 1, '1,3'),
       (11, 1, '10CM+', 4, 1, '1,4'),
       (12, 1, '20CM+', 4, 1, '1,4'),
       (13, 1, '30CM+', 4, 1, '1,4'),
       (14, 1, '成体', 4, 1, '1,4'),
       (15, 1, '10CM+', 5, 1, '1,5'),
       (16, 1, '20CM+', 5, 1, '1,5'),
       (17, 1, '30CM+', 5, 1, '1,5'),
       (18, 1, '成体', 5, 1, '1,5'),
       (23, 1, '爬宠用品', 2, 2, '2'),
       (24, 1, '饲养箱', 23, 2, '2,23'),
       (25, 1, '灯具', 23, 2, '2,23'),
       (26, 1, '寄卖', 1, 1, '1'),
       (27, 1, '其它', 26, 1, '1,26'),
       (28, 1, '食品/饲料', 23, 2, '2,23'),
       (29, 1, '用品', 23, 2, '2,23'),
       (30, 1, '垫材', 23, 2, '2,23'),
       (31, 1, '造景', 23, 2, '2,23'),
       (32, 1, '蛇', 1, 1, '1'),
       (33, 1, '10CM+', 32, 1, '1,32'),
       (34, 1, '20CM+', 32, 1, '1,32'),
       (35, 1, '30CM+', 32, 1, '1,32'),
       (36, 1, '成体', 32, 1, '1,32');
COMMIT;
